package com.surprise.cweb;

import java.util.List;

import org.elasticsearch.common.collect.Lists;

import lombok.AccessLevel;
import lombok.AllArgsConstructor;

@AllArgsConstructor(access = AccessLevel.PRIVATE)
public enum UserRole {
	ADMIN(1, "ADMIN"); // 管理员 
	public int id;
	public String name;
	
	public static UserRole getRoleByType(int type) {
		for (UserRole role : values()) {
			if (role.id == type) {
				return role;
			}
		}
		return null;
	}
}
